#!/usr/bin/env python

class Person:
	'''Represent a person with a name'''

#Class attributes and methods	
	count = 0
	def howMany():
		'''print the count of Person objects'''
		print('We have {0} persons'.format(Person.count))
	howMany = staticmethod(howMany)

#Object attributes and methods
	def __init__(self, name):
		'''init a person'''
		Person.count += 1
		self.name = name
	def __del__(self):
		'''destruct a person'''
		Person.count -= 1
		print('~~~ ' + self.name)
	
	def sayHi(self):
		'''say Hi to you'''
		print('My name is ' + self.name)

class Man(Person):
	'''Man is a special Person'''
	def __init__(self, name, age):
		Person.__init__(self, name)
		self.age = age
		print('Construct a Man')
	def sayHi(self):
		print('Inside Man')

p = Person('boy')
p.sayHi()

q=p
q.sayHi()

q = Person('girl')
q.sayHi()

Person.howMany()

print("-------------------------")
r = Man('Man', 59)
group = [ p, q, r]
for mem in group:
	mem.sayHi()
print("-------------------------")
	
del p
del q

Person.howMany()


